<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:m="http://www.ol4jsf.org"
	xmlns:a4j="http://richfaces.org/a4j">

	<style>
		.noMaskClass .rich-mpnl-mask-div {
			display:none;
		}
		.dataContentEditData {
			width:100%;
			height:330px;
			overflow:auto;
		}
	</style>
	
	<rich:modalPanel id="searchSpatialZoneToolbox"
	minWidth="480" minHeight="270"
	styleClass="noMaskClass"
	resizeable="false"
	zindex="10000">
		<f:facet name="header">
			<h:outputText value="#{messages['interactiveviewer.search_spatial_zone_desc']}"/>
		</f:facet>
		
		<f:facet name="controls">
			<h:panelGroup>
				<h:graphicImage value="/img/close.png" styleClass="hidelink"
					id="searchSpatialZonePanel" />
				<rich:componentControl for="searchSpatialZoneToolbox" attachTo="searchSpatialZonePanel"
					operation="hide" event="onclick" />
			</h:panelGroup>
		</f:facet>
		
		<h:panelGroup id="panelSearch">
			<div align="center">
				<rich:panel>
					<h:form>
						<table style="width: 100%">
							<tr>
								<td width="40%">
									<rich:panel style="width:100%; height: 160px">
										<h:selectOneRadio layout="pageDirection" value="#{interactiveViewerHelper.searchHelper.searchCriteria}">
											<f:selectItem itemLabel="#{messages['txt.cadastral_key']}" itemValue="#{interactiveViewerHelper.searchHelper.BY_CADASTRALKEY}"/>
											<f:selectItem itemLabel="#{messages['txt.municipal_key']}" itemValue="#{interactiveViewerHelper.searchHelper.BY_MUNICIPALKEY}"/>
											<f:selectItem itemLabel="#{messages['txt.field_tab']}" itemValue="#{interactiveViewerHelper.searchHelper.BY_FIELDTAB}"/>
											<f:selectItem itemLabel="#{messages['txt.zone_name']}" itemValue="#{interactiveViewerHelper.searchHelper.BY_NAME}"/>
											<f:selectItem itemLabel="#{messages['txt.national_identity']}" itemValue="#{interactiveViewerHelper.searchHelper.BY_OWNERID}"/>
										</h:selectOneRadio>
									</rich:panel>
								</td>
								<td width="60%">
									<rich:panel style="width:100%; height: 160px">
										<h:outputText value="Texto de busqueda" />
										<br />
										<table>
											<tr>
												<td width="70%">
													<h:inputText value="#{interactiveViewerHelper.searchHelper.searchText}" style="width:100%" />
												</td>
												<td width="30%">
													<a4j:commandButton
														value="#{messages['button.search']}"
														action="#{interactiveViewerHelper.searchHelper.doSearch}"
														reRender="grpSearchResults"
														oncomplete="if (#{facesContext.maximumSeverity == null}) zoomToExtent(#{interactiveViewerHelper.searchHelper.envelopeLeft}, #{interactiveViewerHelper.searchHelper.envelopeBottom}, #{interactiveViewerHelper.searchHelper.envelopeRight}, #{interactiveViewerHelper.searchHelper.envelopeTop})">
													</a4j:commandButton>
												</td>
											</tr>
										</table>
										<div style="width:100%; height:90px; overflow:auto;">
											<h:panelGroup id="grpSearchResults">
												<h:messages errorStyle="color:Red;"/>
												<h:panelGroup rendered="#{not empty interactiveViewerHelper.searchHelper.searchResultList}">
													<ul>
														<ui:repeat var="spatialZone" value="#{interactiveViewerHelper.searchHelper.searchResultList}">
															<li>#{generalHelper.getZoneUsefulName(spatialZone)}</li>
														</ui:repeat>
													</ul>
												</h:panelGroup>
											</h:panelGroup>
										</div>
									</rich:panel>
								</td>
							</tr>
						</table>
						<br />
					</h:form>

					<h:form>
						<a4j:commandButton
							value="#{messages['button.select']}"
							action="#{interactiveViewerHelper.searchHelper.doSelection}"
							reRender="grpSearchResults, grpHighlighted">
						</a4j:commandButton>
						<button
							onclick="#{rich:component('searchSpatialZoneToolbox')}.hide()"
							type="button">
							#{messages['button.close']}
						</button>
					</h:form>
				</rich:panel>
				
			</div>
		</h:panelGroup>
	</rich:modalPanel>

</ui:component>

